package com.cowin.sys.dao;

import com.cowin.base.Mapper;
import com.cowin.inf.model.vo.JphHHVo;
import com.cowin.sys.model.TmVhcVehicleMovement;
import com.cowin.sys.model.vo.DateFormVo;
import com.cowin.sys.model.vo.OutPutVo;
import com.cowin.sys.model.vo.VehicleMovementVo;
import io.swagger.models.auth.In;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import javax.xml.crypto.Data;
import java.util.Date;
import java.util.List;
import java.util.Map;

public interface TmVhcVehicleMovementMapper extends Mapper<TmVhcVehicleMovement> {
    /**
     * 功能描述: 日产量<br>
     *
     * @param outPutVo
     * @return:
     * @since: 1.0.0
     * @Author:yuchao
     * @Date: 2019/10/29 12:40
     */
    List<Map<Integer,Integer>> findDayOutput(OutPutVo outPutVo);

    /**
     * 功能描述: 周月产量<br>
     *
     * @param outPutVo
     * @return:
     * @since: 1.0.0
     * @Author:yuchao
     * @Date: 2019/10/29 12:42
     */
    List<Map<String,Integer>> findScopeOutput(OutPutVo outPutVo);

    /**
     * 功能描述: 根据工位Id 获取所有车辆过点信息Id<br>
     *
     * @param tmBasUlocId
     * @return:
     * @since: 1.0.0
     * @Author:yuchao
     * @Date: 2019/10/30 11:58
     */
    @Select("SELECT TM_VHC_VEHICLE_ID FROM TM_VHC_VEHICLE_MOVEMENT where TM_BAS_ULOC_ID =#{tmBasUlocId}")
    List<Integer> getTmVhcVehicleIdByTmBasUlocId(Integer tmBasUlocId);


    /**
     * 功能描述: 获取过了当前点没到下一点位车辆信息<br>
     *
     * @param
     * @return:
     * @since: 1.0.0
     * @Author:yuchao
     * @Date: 2020/1/10 11:17
     */
    @Select("SELECT DISTINCT(TM_VHC_VEHICLE_ID) FROM TM_VHC_VEHICLE_MOVEMENT where TM_BAS_ULOC_ID=#{startUlocId} minus SELECT DISTINCT(TM_VHC_VEHICLE_ID) FROM TM_VHC_VEHICLE_MOVEMENT where TM_BAS_ULOC_ID= #{endUlocId}")
    List<String> findVehicleBetweenPoint(@Param("startUlocId") Integer startUlocId,@Param("endUlocId")Integer endUlocId);


    /**
     * 功能描述: 查询车辆当天点位经过车辆信息<br>
     *
     * @param
     * @return:
     * @since: 1.0.0
     * @Author:yuchao
     * @Date: 2020/1/10 13:51
     */
    @Select("SELECT DISTINCT(TM_VHC_VEHICLE_ID) FROM TM_VHC_VEHICLE_MOVEMENT where TM_BAS_ULOC_ID=#{ulocId} and  to_char(SCAN_TIME,'yyyy-mm-dd')=to_char(sysdate,'yyyy-mm-dd') ")
    List<String> findVehiclePointThru(Integer ulocId);

    /**
     * 功能描述: 获取某天的产线JPH<br>
     *
     * @param
     * @return:
     * @since: 1.0.0
     * @Author:yuchao
     * @Date: 2020/1/11 14:46
     */
   List<JphHHVo> getRealityJph(@Param("ulocId") String ulocId, @Param("time") Date time);



    /**
     * 功能描述: <br>
     *  <日报 焊装20点 涂装20点 总装30点 年月日>
     * @Param:[dateTime]
     * @Return:java.util.List<com.cowin.sys.model.vo.DateFormVo>
     * @Author:YuChao
     * @Date: 2020/3/25 23:08
     */
    List<DateFormVo> findDateForm(@Param("dateTime") String dateTime);


    /**
     * 功能描述: <br>
     *  <过点信息查询>
     * @param:
     * @return:
     * @author:yuchao
     * @date: 2020/3/30 16:54
     */
    List<VehicleMovementVo> findVehicleMovementInfo(VehicleMovementVo vehicleMovementVo);

    /**
     * 功能描述: 查询集合vin码在是否过点 返回集合中过点数据<br>
     *  <>
     * @param:
     * @return:
     * @author:yuchao
     * @date: 2020/4/9 11:11
     */
    List<String> findVinHasRecordByUlocId(@Param("vins")List<String> vins ,@Param("ulocNo")String ulocNo);

}